package com.clarencezero.mylover.mapper;

import com.clarencezero.mylover.config.springsecurity.MyUserDetails;
import com.clarencezero.mylover.config.springsecurity.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDetailMapper {
    MyUserDetails loadUserByUsername(@Param("username") String username);

    List<Role> getRolesByUserId(Long id);

    int userRegistration(@Param("username") String username, @Param("password") String password);

    List<MyUserDetails> getUserByKeyWords(@Param("keywords") String keywords);

    int updateUser(@Param("myUserDetails") MyUserDetails myUserDetails);

    int deleteRoleByUserId(@Param("hrId") Long userId);

    int addRolesForUser(@Param("userId") Long userId, @Param("rids") Long[] rids);

    MyUserDetails getHrById(@Param("userId") Long userId);

    int deleteUserByid(@Param("userId") Long userId);

    List<MyUserDetails> getAllUser(@Param("currentId") Long currentId);
}
